home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Applications / Games / NeXTmille / Source / SafetyView.m < prev    next >
Text File  |  1991-01-11  |  1KB  |  64 lines

  1.  
  2. /* Generated by Interface Builder */
  3.  
  4. #import "SafetyView.h"
  5. #import    "CardHolder.h"
  6. #import    <assert.h>
  7.  
  8.  
  9. @implementation SafetyView
  10.  
  11.  
  12. + new
  13. {
  14.  
  15.  
  16.     self = [ super new ];
  17.     rotatedFlag = NO;
  18.     
  19.     return self;
  20. }
  21.  
  22.  
  23. - setRotatedFlag:( BOOL )flag
  24. {
  25.  
  26.  
  27.     if( rotatedFlag = flag ) {
  28.         [ self rotateTo:90.0 ];
  29.         [ self setDrawOrigin: -NX_HEIGHT( &bounds ) :0.0 ];
  30.     } else {
  31.         [ self rotateTo:0.0 ];
  32.         [ self setDrawOrigin:0.0 :0.0 ];
  33.     }
  34.     
  35.     return self;
  36. }
  37.  
  38.  
  39.                                                 // One of the advantages of having
  40.                                                 //    the source.  I know what the super class
  41.                                                 //    does so I can take advantage of it.
  42. - drawSelf:( const NXRect * )rects :( int )rectCount
  43. {
  44.  
  45.     BOOL    performDraw = YES;
  46.     
  47.     
  48.     if([ superview respondsTo:@selector(subviewVisible:)])
  49.         if( ![ superview subviewVisible:self ])
  50.             performDraw = NO;
  51.     
  52.     if( performDraw ) 
  53.         if( rotatedFlag ) {
  54.             assert( rotatedBottomFaceBitmap );
  55.             [ rotatedBottomFaceBitmap composite:NX_SOVER toPoint:&bounds.origin ];
  56.         } else
  57.             [ super drawSelf:rects :rectCount ];
  58.     
  59.     return self;
  60. }
  61.  
  62.  
  63. @end
  64.